﻿#region Copyright and License
/*==============================================================================
 *  Copyright (c) cndotnet.org Corporation.  All rights reserved.
 * ===============================================================================
 * This code and information is provided "as is" without warranty of any kind,
 * either expressed or implied, including but not limited to the implied warranties
 * of merchantability and fitness for a particular purpose.
 * ===============================================================================
 * Licensed under the GNU General Public License (GPL) v2
 * http://www.cndotnet.org/ucenter
 * ==============================================================================*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UCenter.Core.Common;
using UCenter.Core.Validations;

namespace UCenter.Core.Service
{
    public static class BusinessCollectionExtension
    {
        public static string ToJSON<TSource>(this List<TSource> source)
            where TSource : BusinessBase
        {
            ValidationUtility.IsNullValidate<List<TSource>>(source);

            return JsonFormaterUtils.Serialize<List<TSource>>(source);
        } 
    }
}
